<template>
  <div class="line-chart" ref="chartRef">

  </div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import * as echarts from 'echarts';
const chartRef = ref();

let chart
const init = (option) => {
  chart.clear();
  chart.setOption(option);
}
onMounted(() => {
  chart = echarts.init(chartRef.value);
})
defineExpose({
  init
})
</script>
<style scoped lang="less">
.line-chart {
  width:90%;
  height:400px;
}
</style>
